Non-Volatile Memory (NVM) provides an intermediate alternative between high-performance Dynamic Random Access Memory (DRAM) and cost-effective hard disk drives (HDDs). Generally, the read performance of NVM is similar to DRAM and the write performance of NVM is significantly faster than HDDs. Moreover, NVM is byte-addressable and writes to NVM are durable, so data stored therein may be accessed directly after a crash and restart, as opposed to reloading such data from HDD into DRAM.
Traditionally, data is stored in DRAM in a tree format including a root node and leaves, with DRAM pointers to downstream leaves. To persist the data, the data is written to HDD in the same format. Specifically, the root node and leaves are written into a persistence file as separate binary chunks, with their pointers mapped to account for offsets of bunches of leaves which point to the start of a new data block. A similar persistence format may be used to persist the data in NVM. As a result of this persistence format, the time required to load persisted data from NVM into DRAM is dependent on the volume of persisted data. Also, the storage of pointers in NVM can be problematic since the same data may not be assigned a same address each time it is mapped to virtual space.
NVM has been considered as a medium to persist database tables. In some implementations, each database table partition includes a delta column fragment and a main column fragment for each of its table columns. A main column fragment may include a column vector of value IDs, a dictionary mapping each value ID to a value, and data structures such as an index mapping dictionary value IDs to positions of the column vector which store each value ID. Although use of a dictionary reduces the amount of memory needed to store the main column fragment (i.e., dictionary compression), database systems may employ additional compression schemes to the column vector of value IDs. It is desirable to persist thusly-compressed main column fragments in and load these main column fragments from NVM while addressing the shortcomings of conventional persistence methods.